package team.knowers.agency.controller;

import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;
import team.knowers.agency.common.convention.result.Result;
import team.knowers.agency.common.convention.result.Results;
import team.knowers.agency.dao.entity.TouristDO;
import team.knowers.agency.service.TouristService;

import java.util.List;

@RestController
@RequiredArgsConstructor
public class TouristController {
    private final TouristService touristService;


    @GetMapping("/api/agency/tourist/find")
    public Result<List<TouristDO>> find(){
        return Results.success(touristService.find());
    }
    @GetMapping("/api/agency/tourist/findOne")
    public Result<TouristDO> findOne(@RequestParam String name){
        return Results.success(touristService.findOne(name));
    }
}
